<form class="page-list-form">
<div class="page-toolbar">
    <div class="layui-btn-group fl">
        <a href="{:url('add')}" class="layui-btn layui-btn-primary"><i class="aicon ai-tianjia"></i>添加</a>   
    </div>
    <div class="page-filter fr">

    </div>
</div>
<div class="layui-form">
    <table class="layui-table mt10" lay-even="" lay-skin="row">
        <colgroup>
            <col width="50">
            <col width="500">
            <col width="50">
            <col width="100">
            <col width="300">
            <col>
        </colgroup>
        <thead>
            <tr>
                <th></th>
                <th>图书馆区域</th>
                <th>排序</th>
                <th>类型</th>
                <th>标签</th>
                <th>操作</th>
            </tr> 
        </thead>
        <tbody>
            <!-- 一级 -->
            {volist name="data_list" id="v"}
            <tr>
                <td><input type="checkbox" class="layui-checkbox checkbox-ids" name="id[]" value="{$v['id']}" lay-skin="primary"></td>
                <td>{$v.areaname}</td>
                <td><input type="text" class="layui-input j-ajax-input input-sort" onkeyup="value=value.replace(/[^\d]/g,'')" 
value="{$v['sort']}" data-value="{$v['sort']}" data-href="{:url('sort?table=area&id='.$v['id'])}"></td>
                <td>{$v.areatype==1 ? '图书馆' : '分区'}</td>
                <td>{$v.tag}</td>
                <td>
                    <div class="layui-btn-group">
                        <div class="layui-btn-group">
                            <a href="{:url('edit?id='.$v['id'])}" class="layui-btn layui-btn-primary layui-btn-sm">编辑</a>
                            <a data-href="{:url('del?id='.$v['id'])}" class="layui-btn layui-btn-primary layui-btn-sm j-tr-del">删除</a>
                            {if condition="$v['areatype'] eq 1"}
                            <a href="{:url('add?id='.$v['id'])}" class="layui-btn layui-btn-primary layui-btn-sm">添加子馆</a>
                            {else}
                            <a href="{:url('layout?id='.$v['id'])}" class="layui-btn layui-btn-primary layui-btn-sm seat">添加座位</a>
                            {/if}
                        </div>
                    </div>
                </td>
            </tr>
                <!-- 二级 -->
                {volist name="v['child']" id="vv"}
                    <tr>
                        <td><input type="checkbox" class="layui-checkbox checkbox-ids" name="id[]" value="{$vv['id']}" lay-skin="primary"></td>
                        <td class="pf2">{$vv.areaname}</td>
                        <td><input type="text" class="layui-input j-ajax-input input-sort" onkeyup="value=value.replace(/[^\d]/g,'')" 
value="{$vv['sort']}" data-value="{$vv['sort']}" data-href="{:url('sort?table=area&id='.$vv['id'])}"></td>
                        <td>{$vv.areatype==1 ? '图书馆' : '分区'}</td>
                        <td>{$vv.tag}</td>
                        <td>
                            <div class="layui-btn-group">
                                <div class="layui-btn-group">
                                    <a href="{:url('edit?id='.$vv['id'])}" class="layui-btn layui-btn-primary layui-btn-sm">编辑</a>
                                    <a data-href="{:url('del?id='.$vv['id'])}" class="layui-btn layui-btn-primary layui-btn-sm j-tr-del">删除</a>
                                    {if condition="$vv['areatype'] eq 1"}
                                    <a href="{:url('add?id='.$vv['id'])}" class="layui-btn layui-btn-primary layui-btn-sm">添加子馆</a>
                                    {else}
                                    <a href="{:url('layout?id='.$vv['id'])}" class="layui-btn layui-btn-primary layui-btn-sm seat">添加座位</a>
                                    {/if}
                                </div>
                            </div>
                        </td>
                    </tr>
                    <!-- 三级 -->
                    {volist name="vv['child']" id="vvv"}
                        <tr>
                            <td><input type="checkbox" class="layui-checkbox checkbox-ids" name="id[]" value="{$vvv['id']}" lay-skin="primary"></td>
                            <td class="pf3">{$vvv.areaname}</td>
                            <td><input type="text" class="layui-input j-ajax-input input-sort" onkeyup="value=value.replace(/[^\d]/g,'')" 
value="{$vvv['sort']}" data-value="{$vvv['sort']}" data-href="{:url('sort?table=area&id='.$vvv['id'])}"></td> 
                            <td>{$vvv.areatype==1 ? '图书馆' : '分区'}</td>  
                            <td>{$vvv.tag}</td>                   
                            <td>
                                <div class="layui-btn-group">
                                    <div class="layui-btn-group">
                                        <a href="{:url('edit?id='.$vvv['id'])}" class="layui-btn layui-btn-primary layui-btn-sm">编辑</a>
                                        <a data-href="{:url('del?id='.$vvv['id'])}" class="layui-btn layui-btn-primary layui-btn-sm j-tr-del">删除</a>
                                        {if condition="$vvv['areatype'] eq 1"}
                                            <a href="{:url('add?id='.$vvv['id'])}" class="layui-btn layui-btn-primary layui-btn-sm">添加子馆</a>
                                        {else}
                                            <a href="{:url('layout?id='.$vvv['id'])}" class="layui-btn layui-btn-primary layui-btn-sm seat">添加座位</a>
                                        {/if}
                                    </div>
                                </div>
                            </td>
                        </tr>
                        <!-- 四级 -->
                        {volist name="vvv['child']" id="vvvv"}
                            <tr>
                                <td><input type="checkbox" class="layui-checkbox checkbox-ids" name="id[]" value="{$vvvv['id']}" lay-skin="primary"></td>
                                <td class="pf4">{$vvvv.areaname}</td>
                                <td><input type="text" class="layui-input j-ajax-input input-sort" onkeyup="value=value.replace(/[^\d]/g,'')" 
value="{$vvvv['sort']}" data-value="{$vvvv['sort']}" data-href="{:url('sort?table=area&id='.$vvvv['id'])}"></td>
                                <td>{$vvvv.areatype==1 ? '图书馆' : '分区'}</td>
                                <td>{$vvvv.tag}</td>
                                <td>
                                    <div class="layui-btn-group">
                                        <div class="layui-btn-group">
                                            <a href="{:url('edit?id='.$vvvv['id'])}" class="layui-btn layui-btn-primary layui-btn-sm">编辑</a>
                                            <a data-href="{:url('del?id='.$vvvv['id'])}" class="layui-btn layui-btn-primary layui-btn-sm j-tr-del">删除</a>
                                            {if condition="$vvvv['areatype'] eq 1"}
                                                <a href="{:url('add?id='.$vvvv['id'])}" class="layui-btn layui-btn-primary layui-btn-sm">添加子馆</a>
                                            {else}
                                                <a href="{:url('layout?id='.$vvvv['id'])}" class="layui-btn layui-btn-primary layui-btn-sm seat">添加座位</a>
                                            {/if}
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <!-- 五级 -->
                            {volist name="vvvv['child']" id="vvvvv"}
                                <tr>
                                    <td><input type="checkbox" class="layui-checkbox checkbox-ids" name="id[]" value="{$vvvvv['id']}" lay-skin="primary"></td>
                                    <td class="pf5">{$vvvvv.areaname}</td>
                                    <td><input type="text" class="layui-input j-ajax-input input-sort" onkeyup="value=value.replace(/[^\d]/g,'')" 
value="{$vvv['sort']}" data-value="{$vvvvv['sort']}" data-href="{:url('sort?table=area&id='.$vvvvv['id'])}"></td>
                                    <td>{$vvvvv.areatype==1 ? '图书馆' : '分区'}</td>
                                    <td>{$vvvvv.tag}</td>
                                    <td>
                                        <div class="layui-btn-group">
                                            <div class="layui-btn-group">
                                                <a href="{:url('edit?id='.$vvvvv['id'])}" class="layui-btn layui-btn-primary layui-btn-sm">编辑</a>
                                                <a data-href="{:url('del?id='.$vvvvv['id'])}" class="layui-btn layui-btn-primary layui-btn-sm j-tr-del">删除</a>
                                                {if condition="$vvvvv['areatype'] eq 2"}
                                                    <a href="{:url('layout?id='.$vvvvv['id'])}" class="layui-btn layui-btn-primary layui-btn-sm seat">添加座位</a>
                                                {/if}
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            {/volist}
                        {/volist}
                    {/volist}
                {/volist}
            {/volist}
        </tbody>
    </table>
</div>
</form>
<style type="text/css">
    .pf2{padding-left:30px !important; }
    .pf3{padding-left:60px !important; }
    .pf4{padding-left:90px !important; }
    .pf5{padding-left:120px !important; }
    .seat{background: #009688;color: #fff;}
    .seat:hover{color: #fff !important;}
</style>
{include file="admin@block/layui" /}